Skip to main content
Question

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


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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings