<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged delete</title>
<link>https://overflow.efficy.io/?qa=tag/delete</link>
<description>Powered by Question2Answer</description>
<item>
<title>How to delete all detail attachements/files contains in an Efficy Document where some of the files have revision?</title>
<link>https://overflow.efficy.io/?qa=6789/delete-detail-attachements-contains-efficy-document-revision</link>
<description>&lt;p&gt;Does anyone knows how to delete all files in a document with ServerJS when some of the files have revision ?&lt;/p&gt;

&lt;p&gt;I tried the following code, but then I have an endless loop since several files have the same key but a different revision number !&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;dsFile = Efficy.getDetailDataSet(docuContext, ntFile);
dsFile.first();
while (!dsFile.eof) {
Efficy.deleteDetail(docuContext, ntFile, dsFile.fieldByName('K_FILE').asFloat);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;PS : I remarked that the same code has been used in Efficy 2021 for the invoicing module (cf function deleteDetails in serverjs\invoicing\invoicing.js) ... So the issue I encountered may also be a standard issue&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6789/delete-detail-attachements-contains-efficy-document-revision</guid>
<pubDate>Fri, 06 Jan 2023 09:34:39 +0000</pubDate>
</item>
<item>
<title>problem occurs when deleting a relation link (Prod_Case)</title>
<link>https://overflow.efficy.io/?qa=6623/problem-occurs-when-deleting-a-relation-link-prodcase</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I have a problem when I'm trying to delete the relation PROD-CASE :&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=1109487536647037541&quot; alt=&quot;enter image description here&quot;&gt;&lt;br&gt;
In the function deleteRelation, the detailKey return keyProd-KRelation &lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=3127600058749840060&quot; alt=&quot;enter image description here&quot;&gt;&lt;br&gt;
It displays this error : &lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=13037993170548430785&quot; alt=&quot;enter image description here&quot;&gt;&lt;br&gt;
There is a custom that has been added in the field (K_RELATION)&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=9120668940095194742&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;

&lt;p&gt;Which tables I need to check to make the delete relation works ? &lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6623/problem-occurs-when-deleting-a-relation-link-prodcase</guid>
<pubDate>Thu, 07 Jul 2022 15:44:22 +0000</pubDate>
</item>
<item>
<title>Get only what's change during the edit context</title>
<link>https://overflow.efficy.io/?qa=4023/get-only-whats-change-during-the-edit-context</link>
<description>&lt;p&gt;Hello Efficy Team, &lt;/p&gt;

&lt;p&gt;I got a complex process where I need to &lt;em&gt;do something&lt;/em&gt; with the &quot;new element&quot; of a detailDataSet, or the deleted elements of the detailDataSet during the edit context.&lt;/p&gt;

&lt;p&gt;What is the best way retrieve only those element ? &lt;/p&gt;

&lt;p&gt;Here is what I did : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    var k_project = Efficy.getEditKey(editHandle);
var relationTable = Efficy.entityCatalog.getRelationEntityTableName(ntProj, TEntityHandle);
var kElement = Efficy.entityCatalog.keyFieldName(TEntityHandle);

var dsDetails = Efficy.sqlQueryDataSet('select * from ' + relationTable + ' where k_project = :param1', k_project, 45);
var newDetails = Efficy.getDetailDataSet(editHandle, TEntityHandle);

var changesInTheEditContext = [];

if(dsDetails || !dsDetails.isEmpty()) {

    // the project is already committed. We need to get only the &quot;new&quot; one
    // for that, we filter the &quot;new one&quot; based on the &quot;old one&quot;

    var existing = [];
    dsDetails.first();
    while (!dsDetails.eof()) {
        existing.push(dsDetails.fieldByName(kElement).asFloat);
        dsDetails.next();
    }

    // ho yeah it is ugly. But seems that &quot;not in ()&quot; does not work
    newDetails.filter = kElement +' &amp;lt;&amp;gt; ' + existing.join(' AND ' +  kElement +  ' &amp;lt;&amp;gt; ');
    newDetails.FilterOptions = existing.length;
    newDetails.Filtered = true;

}

// then we get, for each &quot;new one&quot;, useful information's : entity, key, name

if(newDetails.isEmpty() || !newDetails) return false;
newDetails.first();

while(!newDetails.eof()) {

    changesInTheEditContext.push({
        entity : Efficy.entityCatalog.getEntityName(TEntityHandle),
        key : newDetails.fieldByName(kElement).asFloat,
        name : getName(newDetails.fieldByName(kElement).asFloat, TEntityHandle),
        operation : 'add'
    })

    newDetails.next();
}

newDetails.Filtered = false;

// we also need to detect the opposite : a contact deleted during the edit context
// we use the same ticks, but in the opposite (current detailDataSet filter the SQL)

if(dsDetails || !dsDetails.isEmpty()) {

    var fromRelationTable = [];

    newDetails.first();
    while (!newDetails.eof()) {

        fromRelationTable.push(newDetails.fieldByName(kElement).asFloat);
        newDetails.next();

    }

    // ho yeah it is ugly. But seems that &quot;not in ()&quot; does not work
    dsDetails.filter = kElement +' &amp;lt;&amp;gt; ' + fromRelationTable.join(' AND ' +  kElement +  ' &amp;lt;&amp;gt; ');
    dsDetails.FilterOptions = fromRelationTable.length;
    dsDetails.Filtered = true;

    if(dsDetails.isEmpty() || !dsDetails) return false;
    dsDetails.first();

    while(!dsDetails.eof()) {

        changesInTheEditContext.push({
            entity : Efficy.entityCatalog.getEntityName(TEntityHandle),
            key : dsDetails.fieldByName(kElement).asFloat,
            // name : getName(newDetails.fieldByName(kElement).asFloat, TEntityHandle), -- we don't need the name, he's already displayed
            operation : 'delete'
        })

        dsDetails.next();
    }

    dsDetails.Filtered = true;

}

return changesInTheEditContext;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Is there, by any chance, a way to get those change in a more &quot;Efficy way&quot; than comparing two dataSet ? &lt;/p&gt;

&lt;p&gt;Regards,&lt;/p&gt;

&lt;p&gt;Loïc&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4023/get-only-whats-change-during-the-edit-context</guid>
<pubDate>Tue, 12 Mar 2019 07:49:17 +0000</pubDate>
</item>
<item>
<title>mass delete based on query results</title>
<link>https://overflow.efficy.io/?qa=1940/mass-delete-based-on-query-results</link>
<description>&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;In efficy you can do mass-updates but I'm looking for the way to do a mass-delete based on a query. Does anyone know how/where this can be done?&lt;br&gt;
e.g. I would like to delete all deceased contacts at once ;-)&lt;/p&gt;

&lt;p&gt;Regards&lt;br&gt;
Kathleen&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=1940/mass-delete-based-on-query-results</guid>
<pubDate>Thu, 13 Oct 2016 08:41:45 +0000</pubDate>
</item>
<item>
<title>How to delete Attachments/FILE via SOAP</title>
<link>https://overflow.efficy.io/?qa=1273/how-to-delete-attachments-file-via-soap</link>
<description>&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;I'm trying to delete a file (attachment) via SOAP.&lt;/p&gt;

&lt;p&gt;When executing the following SOAP request:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;efficy:api&amp;gt;
    &amp;lt;data id=&quot;0&quot; operation=&quot;delete&quot; entity=&quot;FILE&quot; keys=&quot;123&quot;/&amp;gt;
&amp;lt;/efficy:api&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I get the following &quot;answer&quot;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;SOAP-ENV:Fault&amp;gt;
    &amp;lt;faultcode&amp;gt;Exception&amp;lt;/faultcode&amp;gt;
    &amp;lt;faultstring&amp;gt;Invalid Entity for Delete&amp;lt;/faultstring&amp;gt;
    &amp;lt;faultid/&amp;gt;
&amp;lt;/SOAP-ENV:Fault&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I also tried entity=&quot;2&quot;, same effect. When logging in as the user i use to perform the SOAP request, i am able to delete the attachment without a problem. So, how can I delete a FILE entry?&lt;/p&gt;

&lt;p&gt;Thanks in advance,&lt;br&gt;
Stefan&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=1273/how-to-delete-attachments-file-via-soap</guid>
<pubDate>Mon, 25 Jan 2016 17:26:10 +0000</pubDate>
</item>
<item>
<title>Synchronization Exchange Queue ( Validation process)</title>
<link>https://overflow.efficy.io/?qa=313/synchronization-exchange-queue-validation-process</link>
<description>&lt;p&gt;How does the validation process works with the new sync exchange queue ? &lt;/p&gt;

&lt;p&gt;What especially interest me is deletion of appointments. &lt;/p&gt;

&lt;p&gt;Here is the case : &lt;/p&gt;

&lt;p&gt;A user have an appointment in Exchange. Only he is linked to it.&lt;br&gt;
Appointment goes to Efficy. &lt;br&gt;
Workflow is activated for sync exchange. Workflow adds another user to this appointment.&lt;br&gt;
User deletes appointment in Outlook. &lt;/p&gt;

&lt;p&gt;=&amp;gt; Will Synch send appointment back to Outlook ? &lt;br&gt;
What are the boundaries (timestemps/configurations) that determine if appointment will be sent to outlook? d&lt;em&gt;change ? d&lt;/em&gt;create ?&lt;/p&gt;
</description>
<category>Efficy Developers</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=313/synchronization-exchange-queue-validation-process</guid>
<pubDate>Fri, 27 Mar 2015 13:23:35 +0000</pubDate>
</item>
</channel>
</rss>