Question

How to save "File" for a "Lead" and also its "Attributes"

  • 3 November 2022
  • 0 replies
  • 53 views

Userlevel 1

Hi everyone,

how i can programmatically save lead attributes? I see that they are shown in “Attribute” view within the LeadMaint graph, but they are not connected with the Lead !? i can create programmatically my CSAnswer object and add AttributeID and its Value but they are not shown….

I have the same problem with saving the attachments from my API into Lead File….

For this case i have made a following code snipped...but when its started i am getting the exception… (when filegrap.SaveFile(fileInfo) is called)…. It is little bit hard for me to understand…..

                        foreach (var attachment in extParticipant.Attachments)
                        {
                            PX.SM.FileInfo fileinfo;
                            using (var client = new SnapAddyClient(snapAddyConfig))
                            {
                                var stream = client.GetAttachment(attachment.Url);
                                if (stream == null)
                                    continue;
                                var data = ReadFully(stream);
                                fileinfo = new PX.SM.FileInfo(attachment.FileId, null, data);
                            }

                            if (filegraph.SaveFile(fileinfo))
                            {
                                if (fileinfo.UID.HasValue)
                                {
                                    //To Attach file
                                    PXNoteAttribute.SetFileNotes(leadGraph.LeadCurrent.Cache, lead, fileinfo.UID.Value);
                                }
                            }
                        }


0 replies

Be the first to reply!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved