This is a public Forum  publicRSS

Topic

    Nishi
    Can we update a custom attribute without using SOAP in an...
    Topic posted May 16, 2018 by NishiWhiz 
    31 Views, 7 Comments
    Title:
    Can we update a custom attribute without using SOAP in an add-in?
    Content:

    Hi friends,

    I am trying to update a custom object lookup on incident workspace through data loaded event by add-in. I tried to use the below code but its not working. SOAP would require saving the workspace which I don't want. Can we populate the custom object ID via add-in functionality only? 

    Version:
    May 17
    Code Block:

    Answer

     

    • Pramod Vasudeva Murthy

      PFA C# code which uses SOAP calls to update Custom only object for Incident. Replace Incident with generic Object it will still work.

      If Location is a lookup then this is not the way to set it up. Lookups are always set through fetching an ID. If Location is a menu then you can use directly IDs.

      ~VIP

    • Nishi

      Hey Pramod, we will have to save the workspace after the update operation code right?

    • Pramod Vasudeva Murthy

      Yes true. I will not recommend API operations in workspace, its a costly process. Try achieving using addins. I think you might need to use AddInsFactory Framework.

      ~VIP

    • Nishi

      Looks like we cannot achieve this without saving the workspace. I tried using addins but it works only on refresh or save. 

    • Pramod Vasudeva Murthy

      Can you please help me understand this? 

      Why would you update a CO on load of Incident? Shouldn't some event like clicked, saved, send email be the trigger? Why the update on visit?

      ~VIP

    • Nishi

      Well that was the requirement, some of the fields were to be auto populated on load.

    • Pramod Vasudeva Murthy

      Check this link, might help you.

      ~VIP