Epicor Functions Maitenance - Part not Updating

Hi,

Currently, I am learning Epicor Functions. I like the idea behind it and would like to use it when the opportunity presents itself. After testing the basics with the diagram editor I noticed the Part does not Update.

I tried the following flow with the process/blocks provided - and also tried the same approach via custom code only (which I will paste below)

The process is:-
Input:
PartNum

Output:
PartDescriptionOut

Variables:
tempPartTableset

Process:

  • Invoke BO Method: GetByID
  • Using input parameter PartNum
  • data returned stored in tempPartTableset
  • Set Field: PartDescription in tempPartTableset to some fixed value.
  • Invoke BO Method: Update using tempPartTableset
  • Set Argument/Variable: PartDescription to tempPartTableset.Part[0].PartDescription.

When I test this (using RestAPI) the PartDescriptionOut is the value I set it to. As the Update method should represetns the parameter (in this case tempPartTableset) as In/Out - then whatever was saved it what should be returned. However, when I refresh the epicor client, the part description has not changed.

I also did another GetByID after the Update (as expected) it did not Save/Update the changes.

I am trying to understand what I am doing wrong.

I also adjusted the function to just run custom code, which I have provided below… and it still does not Save/Update the changes:-

this.CallService<Erp.Contracts.PartSvcContract>(partService => {
try
{
tempPartTableset = partService.GetByID(“10005385”);

    tempPartTableset.Part[0].PartDescription = "MS Change!";

    partService.Update(ref tempPartTableset);

    PartDescriptionOut = tempPartTableset.Part[0].PartDescription;

    tempPartTableset = partService.GetByID("10005385");

    PartDescriptionOut += " -- " + tempPartTableset.Part[0].PartDescription;
  }
  catch(Exception ex) {
    PartDescriptionOut = ex.Message;
  }
});

I am not sure why it does not update. The credentials I am using with the RestAPI is mine… and i am an admin user, etc. I tried running this epicor function in Staging and Live.

As for resources… I found this page helpful. I could not find anything on EPICWeb. I will admit that I could be searching incorrectly.

Once I get over this (basic) hurdle then I can start to do some advanced and useful things with it.

Any advice/suggestion is welcome. We are on 10.2.500.35

Thank you,

M

Are you updating the RowMod field to “U” in the dataset parameter before you pass it to the Update method?

1 Like

Thank you! Something so obvious did the trick!!
I did not do this in the functions because the link I added did not do it in their example (which is a comment, a custom code, near the bottom of the page)

Thanks again – closing ticket!